<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__PHY_LIB.'/inc/page.inc.php');
require_once(__PHY_LIB.'/class/uDirector.class.php');
require_once(__PHY_LIB.'/class/uWork.class.php');

/*/ 首页的推荐视频 ///
$oHomeWorks = new uWorkList('cms_work cw INNER JOIN unit_work w ON w.id=cw.work_id');
$oHomeWorks->cfgField("w.*");
$oHomeWorks->cfgWhere("cw.location='home'");
$oHomeWorks->cfgOrder("cw.rank");
$oHomeWorks->load();
 */

/// 自动显示最新的30个视频 ///
$oHomeWorks = new uWorkList();
$oHomeWorks->cfgOrder("id DESC");
$oHomeWorks->load(30);
//@ echo $oHomeWorks->mSql,"<br />\n";
while ($oOne = $oHomeWorks->nextItem()) {
	$oDirector = new uDirector($oOne->get('director_1_id'), 'title');
	$oOne->set('director_1_title', $oDirector->get('title'));
	$oDirector = new uDirector($oOne->get('director_2_id'), 'title');
	$oOne->set('director_2_title', $oDirector->get('title'));
}
$rHomeWorks = $oHomeWorks->fetchArray();
$oTpl->assign('rHomeWorks', $rHomeWorks);

$oTpl->display(dirname(__FILE__).'/'.basename(__FILE__, '.php').'.tpl');
?>
